
cache = {}
edge = 20 
def search(x, y):
    if x == edge or y == edge:
        return 1
    elif (x, y) in cache:
        return cache[(x, y)] 
    elif x == y:
        result = search(x, y+1)*2
    else:
        result = search(x+1, y) + search(x, y+1)
    cache[(x,y)] = result
    return result

print search(0, 0)

